//
//  COptionView.h
//  HCHK_iphone
//
//  Created by yilong zhang on 12-1-1.
//  Copyright 2012年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "CDBManager.h"
#import "UIViewEx.h"

#define CELL_HEIGHT     40
#define ROW_HEIGHT      50
#define SWITCH_WIDTH    105
#define SWITCH_HEIGHT   27

@class CUser;

//======================================================================================================================

@interface CSwitch : UIViewEx

//@property (nonatomic, assign) UIButton  *m_LeftBtn;
//@property (nonatomic, assign) UIButton  *m_RightBtn;
//@property (nonatomic, assign) BOOL      m_On;

@property (nonatomic, assign) UISwitch  *m_Switch;
@property (nonatomic, assign) id        m_Target;
@property (nonatomic, assign) SEL       m_Action;

-(void)OnButtonDown:(UIButton*)sender;
-(void)SetValue:(BOOL)value;
-(void)AddSwitchTarget:(id)target Selector:(SEL)selector;

@end

//======================================================================================================================

@protocol OptionViewDelegate <NSObject>

@optional
-(void)DidOptionTableViewSelected:(int)index;

@end

//======================================================================================================================

@interface COptionView : UIViewEx

@property (nonatomic, assign) id<OptionViewDelegate> delegate;

@property (nonatomic, assign) CSwitch           *m_Swith1;
@property (nonatomic, assign) CSwitch           *m_Swith2;
@property (nonatomic, assign) CSwitch           *m_Swith3;
@property (nonatomic, assign) CSwitch           *m_Swith4;
@property (nonatomic, assign) CSwitch           *m_Swith5;
@property (nonatomic, assign) CSwitch           *m_Swith6;

-(void)DidSwitchChanged:(CSwitch*)cswitch Value:(NSNumber*)value;
-(void)SetOptionViewInfo;
-(void)DidReceiveSwitchValueChanged:(NSNotification*)notification;

@end
